﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XFPPT.NET.Models
{
    /// <summary>
    /// 基于用户提示、文档等相关内容生成PPT大纲的请求类
    /// </summary>
    public class CreateOutlineByDocRequest
    {
        /// <summary>
        /// 无参构造函数，用于创建一个空的 PPTCreateOutlineByDocRequest 实例。
        /// </summary>
        public CreateOutlineByDocRequest()
        {
        }

        /// <summary>
        /// 带参构造函数，用于根据传入的参数创建 PPTCreateOutlineByDocRequest 实例。
        /// 会对传入的参数进行检查，不为空时才会赋值给对应的属性。
        /// </summary>
        /// <param name="query">用户生成PPT要求（最多8000字；query不能为空字符串、仅包含空格的字符串）</param>
        /// <param name="file">上传文件 (file、fileUrl必填其一)</param>
        /// <param name="fileUrl">文件地址（file、fileUrl必填其一）</param>
        /// <param name="fileName">文件名(带文件名后缀；fileName必填)</param>
        /// <param name="businessId">业务ID（非必传）- 业务方自行决定是否使用</param>
        /// <param name="language">语种</param>
        /// <param name="search">是否联网搜索</param>
        public CreateOutlineByDocRequest(string? query = "", byte[]? file = null, string? fileUrl = "", string? fileName = "",
            string? businessId = "", string? language = "", bool? search = null)
        {
            if (!string.IsNullOrWhiteSpace(query))
            {
                this.query = query;
            }
            if (file != null)
            {
                this.file = file;
            }
            if (!string.IsNullOrWhiteSpace(fileUrl))
            {
                this.fileUrl = fileUrl;
            }
            if (!string.IsNullOrWhiteSpace(fileName))
            {
                this.fileName = fileName;
            }
            if (!string.IsNullOrWhiteSpace(businessId))
            {
                this.businessId = businessId;
            }
            if (!string.IsNullOrWhiteSpace(language))
            {
                this.language = language;
            }
           
            if (search.HasValue)
            {
                this.search = search;
            }
           
        }

        /// <summary>
        /// 用户生成PPT要求（最多8000字；query不能为空字符串、仅包含空格的字符串）
        /// </summary>
        public string? query { get; set; }

        /// <summary>
        /// 上传文件 (file、fileUrl必填其一)
        /// </summary>
        public byte[]? file { get; set; }

        /// <summary>
        /// 文件地址（file、fileUrl必填其一）
        /// </summary>
        public string? fileUrl { get; set; }

        /// <summary>
        /// 文件名(带文件名后缀；fileName必填)
        /// </summary>
        public string? fileName { get; set; }

        /// <summary>
        /// 业务ID（非必传）- 业务方自行决定是否使用
        /// </summary>
        public string? businessId { get; set; }

        /// <summary>
        /// 语种
        /// </summary>
        public string? language { get; set; }

        /// <summary>
        /// 是否联网搜索
        /// </summary>
        public bool? search { get; set; }
    }
}
